/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "popularlocroutes")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Popularlocroutes.findAll", query = "SELECT p FROM Popularlocroutes p"),
    @NamedQuery(name = "Popularlocroutes.findByRouteId", query = "SELECT p FROM Popularlocroutes p WHERE p.routeId = :routeId"),
    @NamedQuery(name = "Popularlocroutes.findByLocationId", query = "SELECT p FROM Popularlocroutes p WHERE p.locationId = :locationId"),
    @NamedQuery(name = "Popularlocroutes.findByFromLoc", query = "SELECT p FROM Popularlocroutes p WHERE p.fromLoc = :fromLoc"),
    @NamedQuery(name = "Popularlocroutes.findByUserId", query = "SELECT p FROM Popularlocroutes p WHERE p.userId = :userId"),
    @NamedQuery(name = "Popularlocroutes.findByDescription", query = "SELECT p FROM Popularlocroutes p WHERE p.description = :description"),
    @NamedQuery(name = "Popularlocroutes.findByDistance", query = "SELECT p FROM Popularlocroutes p WHERE p.distance = :distance"),
    @NamedQuery(name = "Popularlocroutes.findByTimeTaken", query = "SELECT p FROM Popularlocroutes p WHERE p.timeTaken = :timeTaken"),
    @NamedQuery(name = "Popularlocroutes.findByMode", query = "SELECT p FROM Popularlocroutes p WHERE p.mode = :mode"),
    @NamedQuery(name = "Popularlocroutes.findByDateAdded", query = "SELECT p FROM Popularlocroutes p WHERE p.dateAdded = :dateAdded")})
public class Popularlocroutes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "routeId")
    private Integer routeId;
    @Column(name = "locationId")
    private Integer locationId;
    @Size(max = 50)
    @Column(name = "fromLoc")
    private String fromLoc;
    @Lob
    @Size(max = 65535)
    @Column(name = "pathLong")
    private String pathLong;
    @Lob
    @Size(max = 65535)
    @Column(name = "pathLat")
    private String pathLat;
    @Column(name = "userId")
    private Integer userId;
    @Size(max = 200)
    @Column(name = "description")
    private String description;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "distance")
    private Float distance;
    @Size(max = 15)
    @Column(name = "timeTaken")
    private String timeTaken;
    @Size(max = 15)
    @Column(name = "mode")
    private String mode;
    @Column(name = "dateAdded")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateAdded;

    public Popularlocroutes() {
    }

    public Popularlocroutes(Integer routeId) {
        this.routeId = routeId;
    }

    public Popularlocroutes(Integer routeId, Date dateAdded) {
        this.routeId = routeId;
        this.dateAdded = dateAdded;
    }

    public Integer getRouteId() {
        return routeId;
    }

    public void setRouteId(Integer routeId) {
        this.routeId = routeId;
    }

    public Integer getLocationId() {
        return locationId;
    }

    public void setLocationId(Integer locationId) {
        this.locationId = locationId;
    }

    public String getFromLoc() {
        return fromLoc;
    }

    public void setFromLoc(String fromLoc) {
        this.fromLoc = fromLoc;
    }

    public String getPathLong() {
        return pathLong;
    }

    public void setPathLong(String pathLong) {
        this.pathLong = pathLong;
    }

    public String getPathLat() {
        return pathLat;
    }

    public void setPathLat(String pathLat) {
        this.pathLat = pathLat;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Float getDistance() {
        return distance;
    }

    public void setDistance(Float distance) {
        this.distance = distance;
    }

    public String getTimeTaken() {
        return timeTaken;
    }

    public void setTimeTaken(String timeTaken) {
        this.timeTaken = timeTaken;
    }

    public String getMode() {
        return mode;
    }

    public void setMode(String mode) {
        this.mode = mode;
    }

    public Date getDateAdded() {
        return dateAdded;
    }

    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (routeId != null ? routeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Popularlocroutes)) {
            return false;
        }
        Popularlocroutes other = (Popularlocroutes) object;
        if ((this.routeId == null && other.routeId != null) || (this.routeId != null && !this.routeId.equals(other.routeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.Popularlocroutes[ routeId=" + routeId + " ]";
    }
    
}
